import Vue from "vue";
import ComponentTemplate from "./index.vue";
const VueComponent = Vue.extend(ComponentTemplate);

export const dialogPreviewVideoAudio = (option: any) => {
    const vm: any = new VueComponent().$mount();
    if (option) {
        vm.sourceUrl = option.sourceUrl || "";
    }
    vm.$on("onopen", () => {
        if (option && option.open) option.open(vm);
    });
    vm.$on("onclose", () => {
        if (option && option.close) option.close(vm);
    });
    vm.$on("onafterclose", () => {
        if (option && option.afterClose) option.afterClose(vm);
    });
    vm.show = true;
    return vm;
};
